<?php 
	include($_SERVER['DOCUMENT_ROOT']."/headerins.php");
?>

<?php

include($_SERVER['DOCUMENT_ROOT']."/headerFrame.php");

echo'
<div id="contextCaption">Добавление товара.</div>
<div id="insert_response"></div>
<hr>
<form action="javascript:Request('."'".'Material'."'".', '."'".'create'."'".', '."'".''."'".')" method="POST">
    <table border="0" id="contextGrid" cellspacing="0" width="100%">

		
		<tr><th><label for="Code">Код товара</label><input type="text"    id="Code" style="width: 80%;"></th></tr>
		<tr><th><label for="Name">Наименование</label><input type="text"    id="Name" style="width: 80%;"></th></tr>
		<tr><th><label for="MatGroup">Категория товара</label>
					<select id="MatGroup" style="width: 80%;">
';
?>

						<?php

								$result = mysql_query("
									SELECT 
										Id, Name
									FROM matgroup");
								
								$rows = array();
								while($row = mysql_fetch_array($result)){
								   echo '<option value="'.$row['Id'].'">'.$row['Name'].'</option>';  
								}
						?>

<?php
echo '
					</select>	


		</th></tr>
		<tr><th><label for="MatDimension">Ед. измерения</label>
					<select id="MatDimension" style="width: 80%;">
';
?>

						<?php

								$result = mysql_query("
									SELECT 
										Id, Name
									FROM matdimension");
								
								$rows = array();
								while($row = mysql_fetch_array($result)){
								   echo '<option value="'.$row['Id'].'">'.$row['Name'].'</option>';  
								}
						?>
<?php
echo '		
			</select>	


		</th></tr>
		<tr><th><label for="Price1">Цена</label><input type="text"    id="Price1" style="width: 80%;"></th></tr>
		<tr><th><label for="Price2">Цена2</label><input type="text"    id="Price2" style="width: 80%;"></th></tr>
		<tr><th><label for="Ball">Балл</label><input type="text"    id="Ball" style="width: 80%;"></th></tr>
		<tr><th><label for="Active">Актив</label><input type="checkbox" checked="checked"  id="Active" ></th></tr>

    </table>
    <hr>
    <div id="result"><div>

	<input id="button" type="Button"  value="Отмена" title="Отмена" onclick="getPage('."'".'/core/Material/MaterialView.php'."'".')">            
	
	<input id="button" type="submit" value="Сохранить" title="Сохранить введенные данные">
</form>
';
?>
